<?php
// +----------------------------------------------------------------------
// | snake
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2022 http://baiyf.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: NickBai <1902822973@qq.com>
// +----------------------------------------------------------------------
namespace app\admin\validate;

use think\Validate;

class AdValidate extends Validate
{

    protected $rule = [
        ['title|标题', 'require|length:1,40'],
        ['activity_id|关联活动', 'number'],
        ['start_time|开始日期', 'require|date'],
        ['end_time|结束日期', 'require|date'],
        ['ad|活动内容', 'require'],
        ['content|活动说明', 'require']
    ];

    protected $scene = [
        'add'=>['title','activity_id','start_time','end_time','ad'],
        'edit'=>['title','activity_id','start_time','end_time', 'ad'],
    ];

//    public function aaa($value, $rule, $data){
//
//    }



}
